/**
 * 学到了啥：
 * 1.margin外边距，如EdgeInsets.fromLTRB(left,to,right,bottom)
 * 2.padding内边距
*/

import 'package:flutter/material.dart';

class BoxPage extends StatelessWidget {
  final title;
  const BoxPage({Key? key, required this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter盒模型',
      theme: ThemeData(primarySwatch: Colors.amber),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('flutter盒子模型'),
        ),
        body: Center(
          child: Container(
            width: 300,
            height: 300,
            color: Colors.green,
            margin: EdgeInsets.fromLTRB(100, 20, 100, 30),
            child: Container(
                margin: EdgeInsets.fromLTRB(20, 50, 20, 10),
                color: Colors.white60,
                child: Text('这是痕迹二长的文字这是痕迹二长的文字这是痕迹二长的文字这是痕迹二长的文字'),
                padding: EdgeInsets.fromLTRB(15, 15, 15, 15)),
          ),
        ),
      ),
    );
  }
}
